const express = require('express')
const router = express.Router()
const axios = require('axios');
const config = require('../config/config.js')
const expressJoi = require('@escook/express-joi')
const { reg_login_schema } = require('../schema/user')
const user = require('./user/user')
const member = require('./member/index.js')
router.post('/login', expressJoi(reg_login_schema), user.login)
router.post('/reguser', expressJoi(reg_login_schema), user.reguser)

router.get('/getmember', member.getListAsync)

router.get('/getSightbead', member.getSightbead)


router.get('/getuser', async (req, res) => {
    // const { data } = await axios.get('http://47.109.137.14/api/getmember')
    res.send({
        code: 200,
        msg: '获取用户信息成功',
        data: {
            id: 1,
            username: 'admin',
            password: '123456',
        }
    })
})


module.exports = router